<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_repmat</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 13/08/2004</div>
    <p>
      <b>mtlb_repmat</b> - Matlab repmat emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>There is no Scilab equivalent function for Matlab <tt>
        <b>repmat</b>
      </tt> but there are equivalent instructions.</p>
    <p>
    The function <tt>
        <b>mtlb_repmat(M,m[,n])</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>repmat(M,m[,n])</b>
      </tt> when it was not
    possible to know what were the inputs while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_repmat</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of Double type and <tt>
              <b>m</b>
            </tt> is a scalar,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>ones(m,m).*.M</b>
            </tt> and 
        <tt>
              <b>mtlb_repmat(M,m,n)</b>
            </tt> may be replaced by <tt>
              <b>ones(m,n).*.M</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of Boolean type and <tt>
              <b>m</b>
            </tt> is a scalar,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>ones(m,m).*.bool2s(M)</b>
            </tt> and 
        <tt>
              <b>mtlb_repmat(M,m,n)</b>
            </tt> may be replaced by <tt>
              <b>ones(m,n).*.bool2s(M)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of String type and <tt>
              <b>m</b>
            </tt> is a scalar,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>asciimat(ones(m,m).*.asciimat(M))</b>
            </tt> and 
        <tt>
              <b>mtlb_repmat(M,m,n)</b>
            </tt> may be replaced by <tt>
              <b>asciimat(ones(m,n).*.asciimat(M))</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of Double type and <tt>
              <b>m</b>
            </tt> is a vector,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>ones(m(1),m(2),...).*.M</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of Boolean type and <tt>
              <b>m</b>
            </tt> is a vector,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>ones(m(1),m(2),...).*.bool2s(M)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>A</b>
            </tt> is of String type and <tt>
              <b>m</b>
            </tt> is a vector,
        <tt>
              <b>mtlb_repmat(M,m)</b>
            </tt> may be replaced by <tt>
              <b>asciimat(ones(m(1),m(2),...).*.asciimat(M))</b>
            </tt>
          </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_repmat</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="../elementary/ones.htm">
        <tt>
          <b>ones</b>
        </tt>
      </a>,&nbsp;&nbsp;<a href="../elementary/kron.htm">
        <tt>
          <b>kron</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
